package com.yc.cloud.wechat.enums;

import com.yc.cloud.basic.enums.IEnumCode;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum WxGrantTypeEnums implements IEnumCode {

    MINI_PROGRAM("1", "小程序"), SUBSCRIPTION_ACCOUNT("2", "订阅号"), SERVICE_ACCOUNT("3", "服务号"),
    MOBILE_ANDROID("4", "移动端Android");

    /**
     * 状态码
     */
    final String code;
    /**
     * 消息内容
     */
    final String description;

    public static boolean isValidEnum(String code) {
        for (WxGrantTypeEnums fundStatusEnum : WxGrantTypeEnums.values()) {
            if (fundStatusEnum.code.equals(code)) {
                return true;
            }
        }
        return false;
    }
}
